package com.runfast.waimai.web.controller;

import com.runfast.common.utils.TokenUtil;
import com.runfast.common.web.entity.Result;
import com.runfast.waimai.dao.model.RunfastBankaccounts;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.*;

import java.awt.print.Pageable;
import java.util.List;

/**
 * 用户银行卡账户接口
 */
@RestController("userWmBankAccountController")
@RequestMapping(value= "/api/user/wm/bankAccount", headers = "token")
public class BankAccountController {

    /**
     * 获取用户银行卡账户列表
     * @param pageable
     * @param token
     * @return
     */
    @PostMapping("/list")
    public Result<List<RunfastBankaccounts>> bankAccount(@PageableDefault Pageable pageable, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     * 删除银行卡账户
     * @param bankAccountId
     * @param token
     * @return
     */
    @PostMapping("/delete")
    public Result delete(@RequestParam int bankAccountId, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

    /**
     * 添加银行卡账户
     * @param bankaccounts
     * @param token
     * @return
     */
    @PostMapping("/add")
    public Result add(@ModelAttribute RunfastBankaccounts bankaccounts, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }

}
